home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / mod2tutb.zip / LOCMOD2.MOD < prev    next >
Text File  |  1989-01-18  |  1KB  |  45 lines

  1.                                         (* Chapter 13 - Program 2 *)
  2. MODULE LocMod2;
  3.  
  4. FROM InOut IMPORT WriteString, WriteCard, WriteLn;
  5.  
  6. VAR Index : CARDINAL;
  7.  
  8.      MODULE MyStuff;
  9.      IMPORT WriteString, WriteCard, WriteLn;
  10.      EXPORT QUALIFIED WriteStuff;
  11.      VAR Counter : CARDINAL;
  12.           PROCEDURE WriteStuff;
  13.           BEGIN
  14.              Counter := Counter + 3;
  15.              WriteString("The value of the counter is ");
  16.              WriteCard(Counter,8);
  17.              WriteLn;
  18.           END WriteStuff;
  19.      BEGIN
  20.         Counter := 4;
  21.      END MyStuff;
  22.  
  23. BEGIN      (* Main program *)
  24.    FOR Index := 1 TO 8 DO
  25.       MyStuff.WriteStuff;
  26.    END;
  27. END LocMod2.
  28.  
  29.  
  30.  
  31.  
  32. (* Result of execution
  33.  
  34. The value of the counter is       7
  35. The value of the counter is      10
  36. The value of the counter is      13
  37. The value of the counter is      16
  38. The value of the counter is      19
  39. The value of the counter is      22
  40. The value of the counter is      25
  41. The value of the counter is      28
  42.  
  43. *)
  44.  
  45.